# -*- coding: utf-8 -*-
'''
Created on 2013-6-1
法术
@author: 不懂d叛逆
'''
import ccjhObj
class ccjhMagic(ccjhObj.ccjhObj):
	def __init__(self, data):
		self.data = {}
		self.skill = None
		if data:
			self.setTo(data)
		return

	def ToString(self, skill):
		if len(skill.baseSkill) > 0:
			caststring = "/cast %s %s" % (skill.baseSkill, self.get("M"))
		else:
			caststring = "/cast %s %s" % (skill.get("S"), self.get("M"))
		return "%s:%s" % (self.get("N"), caststring)

	def SetSkill(self, skill):
		self.skill = skill
